import request from '@/utils/request'

// 封装登录请求
export function login(data) {
  return request({
    method: 'post',
    url: '/sys/login',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

/*
*获取用户的基本资料
*/
export function getUserInfo(data) {
  return request({
    method: 'post',
    url: '/sys/profile',
    data
  })
}
/*
*获取用户的详细信息
*/
export function getUserDetailById(id) {
  return request({
    url: '/sys/user/' + id
  })
}
